package com.qq2008.game.mojie.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;

/***
 * 时间工具
 */
public class DateUtil {

    // 格式化时间
    public static String fmtDate(Integer timestamp, String pattern) {
        String vv = "" + timestamp;
        long time = Long.valueOf(vv);
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(time * 1000);
        SimpleDateFormat dateFormat = new SimpleDateFormat(pattern);
        return dateFormat.format(calendar.getTime());
    }
}
